/*
 * Interaction.cpp
 *
 *  Created on: Mar 2, 2011
 *      Author: wjfortin
 */

#include "Interaction.h"

using namespace std;

/**
 * Fill in
 */
Interaction::Interaction(Quantity* constant, double sf, double pf, const char* interactionName){

	rate = new Term(constant);
	substrateFactor = sf;
	productFactor = pf;
	name = interactionName;
}

/**
 * Fill in
 */
Interaction::Interaction(double constant, double sf, double pf, const char* interactionName){

	rate = new Term(constant);
	substrateFactor = sf;
	productFactor = pf;
	name = interactionName;
}

/**
 * Fill in
 */
Interaction::~Interaction() {

	delete rate;
}

/**
 * Fill in
 */
double Interaction::getRate()
{
	return rate->getValue();
}

/**
 * Fill in
 */
double Interaction::getRate(int rkStep)
{
	return rate->getValue(rkStep);
}

/**
 * Fill in
 */
void Interaction::setRate(double newRate){

	rate->setFactor(0, newRate);

}

/**
 * Fill in
 */
double Interaction::getSubstrateFactor()
{
	return substrateFactor;
}

/**
 * Fill in
 */
double Interaction::getProductFactor()
{
	return productFactor;
}

/**
 * Fill in
 */
Term* Interaction::getTerm()
{
	return rate;
}

/**
 * Fill in
 */
void Interaction::setProductFactor(double newFactor)
{
	productFactor = newFactor;
}
